package com.study.microservice.service1.service;

import com.study.microservice.service1.api.ConsumerService;
import com.study.microservice.service2.api.ProviderService;
import org.apache.dubbo.config.annotation.Reference;

/**
 * @author MI
 * @version 1.0
 * @date 2020/10/17 22:47
 */
//此标记将方法暴露为dubbo
@org.apache.dubbo.config.annotation.Service
public class ConsumerServiceIml implements ConsumerService {

    @Reference
    ProviderService providerService;

    //dubbo暴露实现接口
    @Override
    public String service() {
        //
        //远程调用
        return "Consumer invoke" + providerService.service();
    }
}
